Segmented virtual machine transport mechanism

ABSTRACT

Providing data to an application running on a segmented virtual machine (VM) is disclosed. Providing data includes opening an interface between the segmented VM and an external data source, transferring data from the external data source to an interface buffer, transferring a first selected amount of data from the interface buffer to a shell VM buffer, transferring a second selected amount of data from the shell VM buffer to a core VM buffer, and providing portions of the data from the core VM buffer to the application in response to read requests from the application.

BACKGROUND OF THE INVENTION

In many computing environments, information may be passed from onedevice to another typically more powerful device to perform certaincomputing tasks, such as processing, storage, or communication. Suchinformation may include processes, data, functions, or any otherinformation that consumes computing resources. Information may be sentin packet form or in some other type of data stream in variousapplications. For example, a virtual machine (VM) may be segmented intotwo segments: a shell VM and a core VM. Function calls to the shell VMmay be passed to the core VM for processing. Segmented virtual machinesare further described in U.S. patent application Ser. No. 10/378,061,entitled SEGMENTED VIRTUAL MACHINE filed Feb. 28, 2003, which isincorporated herein by reference for all purposes.

FIG. 1 is a block diagram illustrating a system with a system with asegmented virtual machine 100. In this example, VM functionality issegmented into shell VM 108 and core VM 112. Shell VM 108 performsinteractions with the external environment, such as with externalapplication 104. Core VM 112 performs VM internal execution functions.External interactions may be passed from external application 104through shell VM 108 to core VM 112 for processing. For example, file ornetwork I/O, operating system calls, and other native libraryinteractions may be passed to/from core VM 112. These interactions maybe forwarded using remote procedure calls (RPC). Many of theseinteractions may include reading or writing data streams to/from anetwork socket or a file. For example, an application running on core VM112 opening a network socket connection may read data from the socketincrementally (e.g., one byte at a time). Each read is associated with aseparate RPC, which introduces latency. If there is enough data beingread, the latency can be significant. It would be desirable to reducethe latency associated with forwarding certain types of interactionsthrough the shell VM.

BRIEF DESCRIPTION OF THE DRAWINGS

Various embodiments of the invention are disclosed in the followingdetailed description and the accompanying drawings.

FIG. 1 is a block diagram illustrating a system with a segmented virtualmachine 100.

FIG. 2 is a block diagram illustrating a transport mechanism fordecreasing latency in a segmented VM.

FIG. 3 is a flowchart illustrating a setup process for a transportmechanism in a segmented VM.

FIG. 4A is a flowchart illustrating a process of reading data at a coreVM.

FIG. 4B is a flowchart illustrating a process of reading data at a shellVM.

FIG. 5A is a flowchart illustrating a process of writing data at a coreVM.

FIG. 5B is a flowchart illustrating a process of writing data at a shellVM.

FIG. 6 is a flowchart illustrating an example of a sequence of readsfrom a socket.

FIG. 7 is a flowchart illustrating an example of a sequence of writes toa socket.

FIG. 8 is a flowchart illustrating another example of a sequence ofwrites to a socket.

DETAILED DESCRIPTION

The invention can be implemented in numerous ways, including as aprocess, an apparatus, a system, a composition of matter, a computerreadable medium such as a computer readable storage medium or a computernetwork wherein program instructions are sent over optical or electroniccommunication links. In this specification, these implementations, orany other form that the invention may take, may be referred to astechniques. In general, the order of the steps of disclosed processesmay be altered within the scope of the invention.

A detailed description of one or more embodiments of the invention isprovided below along with accompanying figures that illustrate theprinciples of the invention. The invention is described in connectionwith such embodiments, but the invention is not limited to anyembodiment. The scope of the invention is limited only by the claims andthe invention encompasses numerous alternatives, modifications andequivalents. Numerous specific details are set forth in the followingdescription in order to provide a thorough understanding of theinvention. These details are provided for the purpose of example and theinvention may be practiced according to the claims without some or allof these specific details. For the purpose of clarity, technicalmaterial that is known in the technical fields related to the inventionhas not been described in detail so that the invention is notunnecessarily obscured.

A segmented virtual machine transport mechanism is disclosed. Anapplication running on the core VM may open an interface to a datasource. Data is “eagerly read” from the interface to a buffer in theshell VM. The data is transferred from the shell VM to the core VM sothat it is locally available to the application running on the core VM.When writing data, the application “lazily writes” data to a buffer inthe core VM. Data from the buffer is transferred to the shell VM fortransmission over the interface.

FIG. 2 is a block diagram illustrating a transport mechanism fordecreasing latency in a segmented VM. In this example, system 200 isshown to include segmented VM 234 interacting with external application230 over interface 206. Segmented VM 234 is shown to include core VM 202and shell VM 204. Core VM 202 includes core VM read buffer 208 and coreVM write buffer 210. Shell VM 204 includes shell VM read buffer 212 andshell VM write buffer 214. Interface 206 includes interface write buffer218 and interface read buffer 216. Interface 206 is the interface to alogical channel between segmented VM 234 and external application 230.For example, the interface could be a socket, file descriptor, or otherappropriate interface. The logical channel uses internal buffering fortransferring data between external application 230 and segmented VM 234.

In this example, interface 206 resides in the operating system kernel,outside of shell VM 204. In other embodiments, interface 206 is residesin shell VM 204 and the interface and buffering is provided inside theshell VM process. For example, this would be the case if it weretunneled over some other protocol, or used SDP or RDMA to bypass thebuffering in the kernel.

In this example, application 203 running on core VM 202 has performed asetup process to create buffers 208-218. For example, control channel232 between core VM 202 and shell VM 204 may be used to perform thesetup process. Buffers 208-218 each may be of any size. In someembodiments, read buffers 208 and 212 are the same size and/or writebuffers 210 and 214 are the same size. In some embodiments, the buffersizes are adaptive. In other words, the size of each buffer may changebased on the amount of data being read or written. In this example, aset of read and write buffers 208-218 is shown for one channel. In someembodiments, for each interface (e.g., file descriptor or socket), aseparate set of read and write buffers is created on the core VM andshell VM.

Data arriving at interface 206 is read by shell VM 204 into shell VMread buffer 212. The data is sent from shell VM read buffer 212 to coreVM read buffer 208, where the data is now locally available toapplication 203. Application 203 can access the data using a local callrather than an RPC, for example. Data arriving at interface 206 is“eagerly read” from interface 206 in that the data is read into shell VMread buffer 212 as soon as it is available at interface 206.

Data written by application 203 to core VM write buffer 210 is sent toshell VM write buffer 214. The data is written to interface write buffer218 and is sent out on the interface (e.g., a socket or file I/O). Thedata is “lazily written” from core VM 202 in that the data is sent toshell VM write buffer 214 not necessarily as soon as it is available.For example, the data may be sent periodically, or whenever core VMwrite buffer 210 is full.

FIG. 3 is a flowchart illustrating a setup process for a transportmechanism in a segmented VM. In this example, a setup process isdescribed for the case where the transport mechanism is used in a socketchannel. An application opens a socket (302). For example, application203 running on core VM 202 opens a socket connection to external datasource 230. The core VM communicates with the shell VM to open anexternal socket (304). For example, core VM 202 uses control channel 232to communicate with shell VM 204 to open external socket 206. Read andwrite buffers are created on the core VM and shell VM for the channel(306). For example, read buffers 208 and 212 and write buffers 210 and214 are created.

Data is eagerly read from the socket into the shell VM read buffer(308). For example, data is eagerly read from interface read buffer 216to shell VM read buffer 212. In some embodiments, the amount of dataread is limited by the space available in the core VM read buffer. Inother words, the data is read up to the space available in the core VMread buffer. For example, there are 2 bytes of space available in thecore VM read buffer and 4 bytes of space available in the shell VM readbuffer. 3 bytes are received at the interface read buffer and need to betransferred. Since there are only 2 bytes of available space in the coreVM read buffer, only 2 bytes will be read from the interface read buffereven though the shell VM read buffer has 4 bytes of available space. Theamount of space available in the core VM read buffer may be sent fromcore VM 202 to shell VM 204, as more fully described below. The data issent from the shell VM read buffer to the core VM read buffer so that itis locally available to application 203.

In some embodiments, the amount of data read is limited by the spaceavailable in the shell VM read buffer, and the amount of data sent fromthe shell VM to the core VM is limited by the space available in thecore VM read buffer.

Data is lazily written from the application into a core VM write buffer(310). For example, data is lazily written to core VM write buffer 210.In some embodiments, the amount of data written is limited by the spaceavailable in the shell VM write buffer. The amount of space available inthe shell VM write buffer may be sent from shell VM 204 to core VM 202,as more fully described below. The data is sent from the core VM writebuffer to the shell VM write buffer so that it can be sent out thesocket 206.

In some embodiments, the amount of data written is limited by the spaceavailable in the core VM write buffer, and the amount of data sent islimited by the space available in the shell VM write buffer.

Any appropriate flow control or back pressure method may be used in thisprocess. Duplicate and/or additive buffering may be used. For example,in some embodiments, the data in shell VM read buffer 212 is not deleteduntil the data in buffer 208 is consumed (i.e., read by application203). Similarly, the data in core VM write buffer 210 is not deleteduntil the data in shell VM write buffer 214 is consumed (i.e., sent outthe socket).

FIG. 4A is a flowchart illustrating a process of reading data at a coreVM. In this example, a reading process is described for the case wherethe data is read from a socket channel. In some embodiments, thisprocess is performed after the setup process of FIG. 3. In this example,a read from the core VM read buffer is attempted (402). For example,application 203 attempts to read 2 bytes from core VM read buffer 208.It is determined whether there is enough data in the core VM read buffer(404) to satisfy the read request. For example, if application 203attempts to read 2 bytes, it is determined whether there are 2 bytes ofdata in core VM read buffer 208. If there is enough data, the data isread from the core VM read buffer (406). Information about the amount ofavailable space in the core VM read buffer is sent to the shell VM(408). For example, information about the last read data (i.e., lastconsumed data) and last received data is sent. In some embodiments, anacknowledgement message (ACK) is sent to the shell VM. The ACK messagecould include the information about the amount of available space in thecore VM read buffer. If the application attempts to read more data, theprocess starts again at (402).

Returning to (404), if it is determined that there is not enough data inthe core VM read buffer to satisfy the read request, the read is blocked(410). Data is later received (412) from the shell VM. For example, thedata could be received from the shell VM in (424), as more fullydescribed below. Information about the amount of available space in thecore VM read buffer is sent to the shell VM (408). The process returnsto (402), in which the application attempts to read again. If asufficient amount of data is present in the core VM read buffer, theread request is satisfied this time. In this example, when data arrives,the blocked read re-attempts the read. The read may be re-attempted atother time(s) in other embodiments.

FIG. 4B is a flowchart illustrating a process of reading data at a shellVM. In this example, a reading process is described for the case wherethe data is read from a socket channel. In some embodiments, thisprocess is performed after the setup process of FIG. 3. In someembodiments, this process is performed in parallel with the readingprocess of FIG. 4A. In this example, data arrives from an external datasource (420). For example, data arrives from external application 230 atsocket interface 206 in interface read buffer 216. It is determinedwhether there is space available in the shell VM read buffer (428). Insome embodiments, it is determined whether there is space available inthe core VM read buffer. The determination may be based on informationsent in (408).

If there is no space, the process goes to (426), as more fully describedbelow. If there is space, data is read into the shell VM buffer (422).For example, data is read from interface read buffer 216 to shell VMread buffer 212. In some embodiments, the data is read up to the spaceavailable in the core VM read buffer. For example, the amount of spaceavailable in the core VM read buffer could be reported in (408). Thedata is sent to the core VM (424). For example, the data is sent fromshell VM read buffer 212 to core VM read buffer 208. The data may besent according to any appropriate transmit protocol. In someembodiments, the data is sent up to the space available in the core VMread buffer. Information about the amount of available space in the coreVM read buffer is received (426). For example, the information could bethat sent in (408), such as an ACK message. Data in the shell VM bufferis deleted, if applicable (427). For example, based on the informationreceived in (426), the data that has been received and/or consumed bythe core VM may be deleted in the shell VM, depending on the type offlow control used. It is determined whether the data received in theinterface read buffer (420) was read to the shell VM read buffer (430).For example, interface read buffer 216 may have more data remainingafter (422). For example, if there was no space available in (428), thedata was not read. If the data was not read, the process returns to(428). If the data was read, the process ends. If new data arrives atthe socket, the process starts again at (420).

FIG. 5A is a flowchart illustrating a process of writing data at a coreVM. In this example, a writing process is described for the case wherethe data is written to a socket channel. In some embodiments, thisprocess is performed after the setup process of FIG. 3. In someembodiments, this process is performed in parallel with the readingprocesses of FIGS. 4A and 4B. In this example, a write to the core VMwrite buffer is attempted (502). For example, application 203 attemptsto write 2 bytes of data to write buffer 208. It is determined whetherthere is enough space in the core VM write buffer (504) to satisfy thewrite request. For example, if application 203 attempts to write 2bytes, it is determined whether there are 2 bytes of available space inwrite buffer 208. In some embodiments, it is determined whether there isspace in the core VM write buffer on the shell VM. If there is enoughspace, the data is written to the core VM write buffer (506). Forexample, the data is written to core VM write buffer 210. In someembodiments, the data is written up to the space available in the shellVM write buffer. For example, the amount of space available in the coreVM read buffer could be reported in (534), as more fully describedbelow. It is determined that the data in the core VM write buffer shouldbe sent to the shell VM (510). For example, the data is sent under oneof the following conditions: the core VM write buffer is full; the coreVM write buffer contains a certain amount of data (e.g., the amount ofdata equals the space available in the shell VM write buffer); or apredetermined amount of time has passed since the last data was writtento the core VM write buffer (the data is sent after a timer expires) orsince the last time the data was sent (the data is sent periodically).The data is sent to the shell VM (514). For example, the data is sentfrom core VM write buffer 210 to shell VM write buffer 214. The data maybe sent according to any appropriate transmit protocol. In someembodiments, the data is sent up to the space available in the shell VMwrite buffer. Information about the amount of available space in theshell VM write buffer is received (516). In some embodiments,information about the last write data and last received data in thebuffer is received. The information could be that sent in (534), as morefully described below. Data in the core VM buffer is deleted, ifapplicable (518). For example, based on the information received in(516), the data that has been received and/or consumed by the shell VMmay be deleted in the core VM buffer, depending on the type of flowcontrol used. If the application attempts to write more data, theprocess starts again at (502).

Returning to (504), if there is not enough available space, the write isblocked (512). In some embodiments, the process proceeds to (514) andthe core VM write buffer data is sent to the shell VM (514). The processreturns to (502) in which the application attempts to write again. If asufficient amount of space is present in the core VM write buffer, thewrite request is satisfied this time. If the application attempts towrite more data, the process starts again at (502).

FIG. 5B is a flowchart illustrating a process of writing data at a shellVM. In this example, a writing process is described for the case wherethe data is written to a socket channel. In some embodiments, thisprocess is performed after the setup process of FIG. 3. In someembodiments, this process is performed in parallel with the processes ofFIGS. 4A, 4B, and 5A. In this example, data is received from the core VMwrite buffer (530). For example, the data could be that sent in (514).For example, the data from core VM write buffer 210 is sent to shell VM204 and placed in shell VM write buffer 214. The data is written to thesocket buffer (532). For example, the data from shell VM write buffer214 is written to interface write buffer 218. The data can then be sentover the socket connection. Information about the amount of availablespace in the shell VM write buffer is sent to the core VM (534). Forexample, the information could be that received in (516). If more dataarrives from the core VM, the process starts again at (530).

FIG. 6 is a flowchart illustrating an example of a sequence of readsfrom a socket. This is an example of the processes of FIGS. 4A and 4Bperformed on system 200. In this example, core VM read buffer 208 isinitially empty. Core VM read buffer 208 is 20 kB in size. In thisexample, application 203 attempts to read 2 bytes from core VM readbuffer 208 (602). Application 203 blocks the read because there iscurrently not enough data in core VM read buffer 208 (604). 2 kB of dataarrives at shell VM socket interface read buffer 216 (606). Shell VM 204reads available data from socket buffer 216 up to the space available incore VM buffer 208 into shell VM buffer 212 (608). The space in core VMbuffer 208 can be determined based on a previous ACK message sent fromcore VM 202, for example. In this example, core VM read buffer 208 isempty and is 20 kB in size, so all 2 kB are placed in shell VM readbuffer 212. Shell VM 204 sends buffered data from shell VM read buffer212 to core VM read buffer 208 (610). Core VM 202 communicates theamount of available space in core VM read buffer 208 to shell VM 204(612). For example, an ACK message is sent that includes informationabout the data that was last received and data that was last consumed bycore VM read buffer 208. Optionally, core VM 202 notifies application203 that data has arrived at core VM read buffer 208 (614). Application203 reads 2 B of data from core VM read buffer 208 (616) to satisfy theblocked read request. Core VM read buffer 208 now has 2 kB-2B of data.(614) is optional. For example, application 203 may later (e.g.,periodically) attempt to read the 2B of data. As shown, data is eagerlyread from socket interface read buffer 216 and sent to core VM readbuffer 208 so that it is locally available to application 203.

Application 203 then attempts to read 1 kB of data on core VM 202 (618).The read is satisfied (620). Core VM read buffer 208 now has 2 kB-2 B ofdata. Application 203 attempts to read 2 kB of data from core VM readbuffer 208 (622). Application 203 blocks the read attempt because thereis not enough data in core VM read buffer 208 to satisfy the read (624).The process continues similarly. As data arrives at interface 206, it isplaced in shell VM read buffer 212. The data is sent from shell VM readbuffer 212 to core VM read buffer 208 so that it is locally available toapplication 203 when requested.

FIG. 7 is a flowchart illustrating an example of a sequence of writes toa socket. This is an example of the processes of FIGS. 5A and 5Bperformed on system 200. In this example, application 203 attempts towrite 1 byte of data to socket interface 206 (702). Core VM 202 places 1byte in core VM write buffer 210 and waits (704). Application 203attempts to write 200 bytes of data to socket interface 206 (706). CoreVM 202 places 200 bytes in core VM write buffer 210 and waits (708).Core VM write buffer 210 now has 201 bytes of data. Core VM 202accumulates data in core VM write buffer 210 up to space available incore VM write buffer 214 (710). Core VM 202 sends the contents of coreVM write buffer 210 to shell VM 204 (712). Shell VM 204 receives thedata and writes the data to socket interface write buffer 218 (714).Shell VM communicates the amount of available space in shell VM writebuffer 214 back to core VM 202 (716). For example, an ACK message issent. The process continues similarly.

FIG. 8 is a flowchart illustrating another example of a sequence ofwrites to a socket. This is an example of the processes of FIGS. 5A and5B performed on system 200. In this example, shell VM write buffer 214is initially empty. Shell VM write buffer 214 is 20 kB in size. In thisexample, application 203 attempts to write 10 kB of data to the socket(818). Core VM 202 places 10 kB in core VM write buffer 210 and waits(820). Application 203 attempts to write 11 kB of data to socketinterface 206 (822). Application 203 blocks the write because there isnot enough space available in shell VM write buffer 214 to accommodatethe accumulated 21 kB of data in core VM write buffer 210 (824). Core VM202 sends the contents of core VM write buffer 210 to shell VM 204(826). Core VM 202 receives information about the amount of availablespace in shell VM write buffer 214. When there is 11 kB of spaceavailable, core VM 202 notifies application 203 (828). Core VM 202places 11 kB of data in core VM write buffer 210 to satisfy the blockedwrite request and waits (830). The process continues similarly. (828) isoptional. For example, application 203 may later (e.g., periodically)attempt to write the 11 kB of data.

In the examples described in FIGS. 6-8, data is read into a sendingbuffer up to the available space in a receiving buffer. In the case of aread, data is read into shell VM read buffer 212 up to the availablespace in core VM read buffer 208. In the case of a write, data iswritten into core VM write buffer 210 up to the available space in shellVM write buffer 214. This can ensure that more data is not sent than canbe stored in the final receiving buffer. Alternatively, data can be readinto the sending buffer up to the available space in the sending buffer,and data is sent to the receiving buffer up to the available space inthe receiving buffer. For example, in the case of a read, data is readinto shell VM read buffer 212 up to the available space in shell VM readbuffer 212, but data is sent up to the available space in shell VM readbuffer 212. In the case of a write, data is written into core VM writebuffer 210 up to the available space in core VM write buffer 210, butsent up to the available space in shell VM write buffer 214.

When reading, an application can use a blocking read (in which case theread will wait until data is available) or a non blocking read (in whichcase the read will return regardless of the number of bytes read). Bothforms return the number of bytes actually read. Similarly, when writing,an application can use a blocking write (in which case the write willwait until space is available) or a non blocking write (in which casethe write will return regardless of the number of bytes written). Bothforms return the number of bytes actually written.

In some implementations, a blocking read will return as long as at leastone byte was read, and the return value indicates how many bytes wereread. It will block only if there is no data available. Some blockingwrite implementations will return only after at least one byte waswritten, and the return value indicates how many bytes were written.

In some embodiments, the receiving and sending buffers for each path arethe same size. For example, core VM read buffer 208 and shell VM readbuffer 212 could be the same size and core VM write buffer 210 and shellVM write buffer 214 could be the same size. In some embodiments, thesize of each buffer varies according to the amount of data that is sentor received at that buffer.

In some cases, there may be native code running on the shell VM thatinteracts with the interface (e.g., socket). For example, the shell VMmay make a JNI call to a native C program that is interacting with thesocket at the same time. In this case, an intercept library is providedthat intercepts native API calls from the shell VM that interact withthe same socket being buffered. The calls may be intercepted andredirected to the core VM.

In some embodiments, data is transferred from an interface buffer to ashell VM buffer when the interface is being closed. In some embodiments,a request to close the interface is complete when all buffered data inthe core VM buffer and shell VM buffer is transferred to the interfacebuffer. In some embodiments, a request to close the interface iscomplete when all buffered data in the core VM buffer, shell VM buffer,and interface buffer is transferred to the external data destination.

Core VM 202 and shell VM 204 may run on the same or separate devices. Insome embodiments, state information between the core VM and the shell VMis synchronized. State information can include, for example; time; filestate (e.g., existence, last modified time, size, file content); anddirectory structure. For example, one segment of the VM (i.e., the coreVM or the shell VM) could periodically execute an RPC requesting thelocal time on the other segment. Having to send updates between theshell VM and core VM increases latency in the segmented VM. One approachto reducing latency is to send updates less frequently and have onesegment of the VM cache the state information. For example, thedirectory structure can be cached on one segment. When a path needs tobe built, the cached directory structure can be used. The cacheddirectory structure is updated when there is a change in the directorystructure on the other segment.

A state model can be maintained to model the state of the other segment.Based on the model, the cached state information is updated. If there isa change in state not accounted for by the model, the other segmentsends an update. For example, if the state is time, shell VM 204 cansend its local time to core VM 202. Core VM 202 updates its local timeto match the local time on shell VM 204. In some embodiments, core VM202 uses a time model to continuously update its local time, rather thanrely on updates from shell VM 204. For example, the time model could bea local clock. In some embodiments, shell VM 204 sends updates to coreVM 202 periodically to resynchronize the shell VM and core VM. In someembodiments, shell VM 204 sends an update to core VM 202 when there is achange in time on shell VM 204 not accounted for by the model. Forexample, a user might change the time manually. Similarly, shell VM 204can run a state model while core VM 202 is the segment sending theupdates.

An application running on a first segment of the VM could send a requestto the second segment of the VM to initiate the receiving and storing ofstate information on the first segment. The request could be for stateinformation or to modify state information. In some embodiments, when asegment makes a request to modify the state information, the stateinformation stored in that segment is invalidated. In some embodiments,the state information expires after a period of time. In someembodiments, the state information does not change unless a certainamount of time has elapsed.

Although the foregoing embodiments have been described in some detailfor purposes of clarity of understanding, the invention is not limitedto the details provided. There are many alternative ways of implementingthe invention. The disclosed embodiments are illustrative and notrestrictive.

1. A method of providing data to an application running on a segmentedvirtual machine (VM), comprising: opening an interface to a logicalchannel between the segmented VM and an external data source, whereinthe segmented VM functions as a single VM comprising a core VMconfigured to perform VM internal execution functionality and a shell VMconfigured to communicate with the core VM and perform interactions withthe external data source over the interface; transferring data from theexternal data source to an interface buffer; transferring a firstselected amount of data from the interface buffer to a shell VM bufferassociated with the shell VM of the segmented VM; transferring a secondselected amount of data from the shell VM buffer to a core VM bufferassociated with the core VM of the segmented VM; and providing portionsof the data from the core VM buffer to the application in response toread requests from the application.
 2. A method as recited in claim 1,wherein transferring the first or second selected amount of data isperformed independently of an application requesting data.
 3. A methodas recited in claim 1, wherein transferring the first or second selectedamount of data is performed when data is available at the interface. 4.A method as recited in claim 1, wherein transferring the first or secondselected amount of data is performed periodically at the interface.
 5. Amethod as recited in claim 1, wherein the interface is a socket.
 6. Amethod as recited in claim 1, wherein the interface is a filedescriptor.
 7. A method as recited in claim 1, wherein the firstselected amount is the same as the second selected amount.
 8. A methodas recited in claim 1, wherein the size of the shell VM buffer and thesize of the core VM buffer are equal.
 9. A method as recited in claim 1,wherein the first or second selected amount is based on the amount ofavailable space in the core VM buffer.
 10. A method as recited in claim1, further including sending information about the amount of availablespace in the core VM buffer to the shell VM.
 11. A method as recited inclaim 1, wherein the size of at least one buffer varies with time.
 12. Amethod as recited in claim 1, wherein transferring data to the core VMbuffer includes aggregating the data with data from other channels. 13.A method as recited in claim 1, wherein transferring data to the core VMbuffer includes multiplexing the data with data from other channels. 14.A method as recited in claim 1, further including redirecting a nativeAPI call from the shell VM to the core VM.
 15. A method as recited inclaim 1, wherein the segmented VM includes a shell VM, and wherein theshell VM provides the interface buffer.
 16. A method as recited in claim1, wherein the interface is an interface to a logical channel betweenthe segmented VM and an external application.
 17. A method as recited inclaim 1, wherein the shell VM and core VM communicate over a controlchannel and a data channel.
 18. A method as recited in claim 17, whereinthe second selected amount of data is transferred data from the shell VMbuffer to the core VM buffer over the data channel.
 19. A method asrecited in claim 17, wherein the control channel is used to perform asetup process to create one or more of: the shell VM buffer, the core VMbuffer, and the interface buffer.
 20. A method as recited in claim 1,wherein the interface resides in an operating system kernel outside ofthe shell VM.
 21. A method as recited in claim 1, wherein the interfaceresides in the shell VM.
 22. A method of transmitting data from anapplication running on a segmented virtual machine (VM), comprising:opening an interface to a logical channel between the segmented VM andan external data destination, wherein the segmented VM functions as asingle VM comprising a core VM configured to perform VM internalexecution functionality and a shell VM configured to communicate withthe core VM and perform interactions with the external data source overthe interface; writing portions of data to a core VM buffer associatedwith the core VM of the segmented VM in response to write requests fromthe application; transferring a first selected amount of data from thecore VM buffer to a shell VM buffer associated with the shell VM of thesegmented VM, wherein transferring the first selected amount of data isperformed when a timer expires; transferring a second selected amount ofdata from the shell VM buffer to an interface buffer; and transmittingdata from the interface buffer to the external data destination.
 23. Amethod as recited in claim 22, wherein transferring the first selectedamount of data is performed periodically.
 24. A method as recited inclaim 22, wherein transferring the first selected amount of data isperformed when the core VM buffer is full.
 25. A method as recited inclaim 22, wherein transferring the first selected amount of data isperformed when the interface is being closed.
 26. A method as recited inclaim 22, wherein a request to close the interface is complete when allbuffered data in the core VM buffer and shell VM buffer is transferredto the interface buffer.
 27. A method as recited in claim 22, wherein arequest to close the interface is complete when all buffered data in thecore VM buffer, shell VM buffer, and interface buffer is transferred tothe external data destination.
 28. A method as recited in claim 22,wherein transferring the first selected amount of data is performed whenthe amount of data in the core VM buffer equals the amount of availablespace in the shell VM buffer.
 29. A method as recited in claim 22,wherein the interface is a socket.
 30. A method as recited in claim 22,wherein the interface is a file descriptor.
 31. A method as recited inclaim 22, wherein the first selected amount of data is the same as thesecond selected amount of data.
 32. A method as recited in claim 22,wherein the size of the shell VM buffer and the size of the core VMbuffer are equal.
 33. A method as recited in claim 22, wherein the firstselected amount is based on the amount of available space in the shellVM buffer.
 34. A method as recited in claim 22, further includingsending information about the amount of available space in the shell VMbuffer to the core VM.
 35. A method as recited in claim 22, wherein thesize of at least one buffer varies with time.
 36. A method as recited inclaim 22, wherein transferring data to the shell VM buffer includesaggregating the data with data from other channels.
 37. A method asrecited in claim 22, wherein transferring data to the shell VM bufferincludes multiplexing the data with data from other channels.
 38. Amethod as recited in claim 22, wherein the interface is an interface toa logical channel between the segmented VM and an external application.39. A method as recited in claim 22, wherein the shell VM and core VMcommunicate over a control channel and a data channel.
 40. A method asrecited in claim 39, wherein the first selected amount of data istransferred data from the core VM buffer to the shell VM buffer over thedata channel.
 41. A method as recited in claim 39, wherein the controlchannel is used to perform a setup process to create one or more of: theshell VM buffer, the core VM buffer, and the interface buffer.
 42. Amethod as recited in claim 22, wherein the interface resides in anoperating system kernel outside of the shell VM.
 43. A method as recitedin claim 22, wherein the interface resides in the shell VM.
 44. A systemfor providing data to an application running on a segmented virtualmachine (VM), comprising: a processor configured to: open an interfaceto a logical channel between the segmented VM and an external datasource, wherein the segmented VM functions as a single VM comprising acore VM configured to perform VM internal execution functionality and ashell VM configured to communicate with the core VM and performinteractions with the external data source over the interface; transferdata from the external data source to an interface buffer; transfer afirst selected amount of data from the interface buffer to a shell VMbuffer associated with the shell VM of the segmented VM; transfer asecond selected amount of data from the shell VM buffer to a core VMbuffer associated with the core VM of the segmented VM; and provideportions of the data from the core VM buffer to the application inresponse to read requests from the application.
 45. A computer programproduct for providing data to an application running on a segmentedvirtual machine (VM), the computer program product being embodied in acomputer readable storage medium and comprising computer instructionsfor: opening an interface to a logical channel between the segmented VMand an external data source, wherein the segmented VM functions as asingle VM comprising a core VM configured to perform VM internalexecution functionality and a shell VM configured to communicate withthe core VM and perform interactions with the external data source overthe interface; transferring data from the external data source to aninterface buffer; transferring a first selected amount of data from theinterface buffer to a shell VM buffer associated with the shell VM ofthe segmented VM; transferring a second selected amount of data from theshell VM buffer to a core VM buffer associated with the core VM of thesegmented VM; and providing portions of the data from the core VM bufferto the application in response to read requests from the application.46. A system for transmitting data from an application running on asegmented virtual machine (VM), comprising: a processor configured to:open an interface to a logical channel between the segmented VM and anexternal data destination, wherein the segmented VM functions as asingle VM comprising a core VM configured to perform VM internalexecution functionality and a shell VM configured to communicate withthe core VM and perform interactions with the external data source overthe interface; write portions of data to a core VM buffer associatedwith the core VM of the segmented VM in response to write requests fromthe application; transfer a first selected amount of data from the coreVM buffer to a shell VM buffer associated with the shell VM of thesegmented VM, wherein transferring the first selected amount of data isperformed when a timer expires; transfer a second selected amount ofdata from the shell VM buffer to an interface buffer; and transmit datafrom the interface buffer to the external data destination.
 47. Acomputer program product for transmitting data from an applicationrunning on a segmented virtual machine (VM), the computer programproduct being embodied in a computer readable storage medium andcomprising computer instructions for: opening an interface to a logicalchannel between the segmented VM and an external data destination,wherein the segmented VM functions as a single VM comprising a core VMconfigured to perform VM internal execution functionality and a shell VMconfigured to communicate with the core VM and perform interactions withthe external data source over the interface; writing portions of data toa core VM buffer associated with the core VM of the segmented VM inresponse to write requests from the application; transferring a firstselected amount of data from the core VM buffer to a shell VM bufferassociated with the shell VM of the segmented VM, wherein transferringthe first selected amount of data is performed when a timer expires;transferring a second selected amount of data from the shell VM bufferto an interface buffer; and transmitting data from the interface bufferto the external data destination.